package com.maya.medicalwastes.entity;

import java.io.Serializable;

/**
 * @description 弹出框数据模型
 * @user gzl
 * @date 2017/4/21
 * @time 14:55
 */

public class SpinnerBaseEntity implements Serializable {
    public SpinnerBaseEntity() {
    }

    /**
     * 长id
     */
    private Long longKey;
    /**
     * 字符串id
     */
    private String id;
    /**
     * id
     */
    private int key;
    /**
     * 值
     */
    private String value;
    /**
     * 是否被选中
     */
    private boolean isSelect = false;

    public SpinnerBaseEntity(Long longKey, String value, boolean isSelect) {
        this.longKey = longKey;
        this.value = value;
        this.isSelect = isSelect;
    }

    public SpinnerBaseEntity(int key, String value, boolean isSelect) {
        this.key = key;
        this.value = value;
        this.isSelect = isSelect;
    }

    public SpinnerBaseEntity(String id, String value, boolean isSelect) {
        this.id = id;
        this.value = value;
        this.isSelect = isSelect;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Long getLongKey() {
        return longKey;
    }

    public void setLongKey(Long longKey) {
        this.longKey = longKey;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }


    /**
     * @description 获取独一无二的id
     * @author gzl
     * @time 2018/1/11 16:45
     */
    public String getUniqueId() {
        if (longKey != null) {
            return longKey.longValue() + "";
        } else if (id != null) {
            return id;
        } else {
            return key + "";
        }
    }
}
